let url = require('url')

let urlObj = url.parse('http://www.baidu.com?name=杰克&age=18#mid&foot')
/*
Url {
  protocol: 'http:',
  slashes: true,
  auth: null,
  host: 'www.baidu.com',
  port: null,
  hostname: 'www.baidu.com',
  hash: '#mid&foot',
  search: '?name=杰克&age=18',
  query: 'name=杰克&age=18',
  pathname: '/',
  path: '/?name=杰克&age=18',
  href: 'http://www.baidu.com/?name=杰克&age=18#mid&foot'
}
*/
console.log(urlObj)



